package com.blog.cloud.core.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * 响应状态枚举
 *
 * @author 龙茶清欢
 * @since 2022-11-06 12:32:55
 */
@Getter
@RequiredArgsConstructor
public enum HttpCode {

    OK(200, "请求成功"),
    BAD_REQUEST(400, "错误的请求"),
    UNAUTHORIZED(401, "请求要求身份验证"),
    FORBIDDEN(403, "服务器拒绝请求"),
    NOT_FOUND(404, "服务器找不到请求的网页"),
    METHOD_NOT_ALLOWED(405, "禁用请求中指定的方法"),
    REQUEST_TIMEOUT(408, "服务器等候请求时发生超时"),
    GONE(410, "请求的资源已永久删除"),
    PAYLOAD_TOO_LARGE(413, "请求实体过大"),
    URI_TOO_LONG(414, "请求的 URI 过长"),
    TOO_MANY_REQUESTS(429, "请求太多"),
    INTERNAL_SERVER_ERROR(500, "服务器内部错误"),
    BAD_GATEWAY(502, "错误网关"),
    SERVICE_UNAVAILABLE(503, "服务不可用"),
    GATEWAY_TIMEOUT(504, "网关超时");

    /**
     * 响应状态码
     */
    private final int code;

    /**
     * 响应信息
     */
    private final String msg;

}

